package com.ll.app.api.req;

import com.ll.base.enums.ResultCodeEnum;
import com.ll.base.exception.CustomRunTimeException;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotNull;

@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class SignupReqDTO {

    @NotNull(message = "studentUserId 不能为null")
    @ApiModelProperty(value = "学员的钉钉用户id", example = "123456")
    private String studentUserId;

    @NotNull(message = "courseId 不能为null")
    @ApiModelProperty(value = "课程id", example = "10001")
    private Long courseId;

    @NotNull(message = "teacherId 不能为null")
    @ApiModelProperty(value = "讲师id", example = "10001")
    private String teacherDingId;

    public void checkSignup(){
        if(studentUserId.equals(teacherDingId)){
            throw new CustomRunTimeException(ResultCodeEnum.SIGNUP_ERROR);
        }
    }
}
